package com.levi.repository;

import com.levi.domain.User;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author shentong
 * @since 2022/2/8 9:04 PM
 * 类似于jpa，可以根据字段自动生成api
 */
@Repository
public interface UserRepository extends MongoRepository<User,String> {

    List<User> findByNameAndAge(String name, Integer age);

    List<User> findUserByAgeBetween(Integer begin, Integer end);

}
